class SystemicVascularResistance():
    def __init__(self):
        # http://doctor-network.com/public/LittleTools/13.html
        pass

    def calc(self, data):
        """
        血流阻力
        """
        MAP = int(data['MAP'])  # 平均动脉压 mean arterial pressure
        CVP = int(data['CVP'])  # 中心静脉压 Central venous pressure
        CO = float(data['CO'])  # 心输出量 Cardiac output
        SVR = round(80 * (MAP - CVP) / CO, 2)
        if 800 <= SVR <= 1200:
            return {"SVR": SVR, "status": "血流阻力在正常范围"}
        else:
            return {"SVR": SVR, "status": "血流阻力不在正常范围"}


if __name__ == '__main__':
    print(SystemicVascularResistance().calc({"MAP": "78", "CVP": "76", "CO": "1.3"}))
